//
//  SDTableViewCell.m
//  UI
//
//  Created by apple on 2017/7/4.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "SDTableViewCell.h"
#import <SDAutoLayout.h>
@implementation SDTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {

        self.label = [[UILabel alloc] init];
        self.label.text = @"jiade";
        [self.contentView addSubview:self.label];
        //masonry布局
        [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.mas_equalTo(self.contentView.mas_top).offset(10);
            make.left.mas_equalTo(self.contentView.mas_left).offset(10);
            make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
            make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-10);

        }];
        
        self.label.font = [UIFont systemFontOfSize:12];
        
        self.label.numberOfLines = 0;
    }
    
    return self;
}

/**
 建立一个空的model类，添了一个string属性summary，在cell类中写个set

 @param model model类
 */
- (void)setModel:(Model *)model{

    _model = model;
    self.label.text = _model.summary;
}




- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
